from tools.treeNode import Tree


# 中序遍历
def inorderTraversal(root):
    if not root: return []
    left = inorderTraversal(root.left) if root.left else []
    right = inorderTraversal(root.right) if root.left else []
    res = left + [root.val] + right
    return res


root = Tree(10)
root.left = Tree(2)
root.left.left = Tree(4)
root.left.right = Tree(5)
root.right = Tree(3)
root.right.left = Tree(6)
root.right.right = Tree(7)
print(inorderTraversal(root))
